﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Campus.Main.Basic.InsertValues;

namespace Campus.Main.Basic.Settings
{
    public partial class BedCountForm : Default
    {
        public BedCountForm(string room_id)
        {
            InitializeComponent();
            Room = room_id;
            Text = Room;
        }
        public BedCountForm(List<string> data)
        {
            InitializeComponent();
            Room = data[0];
            Count = Int32.Parse(textBox1.Text = data[1]);
            Text = Room;
        }
        protected string Room { get; set; }
        protected int Count { get; set; }

        protected override void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text != String.Empty)
            {
                int count = Int32.Parse(textBox1.Text);
                aToDb.Call("call bedinsert(" + count + "," + Room + ")");
                Close();
            }
            else
            {
                MessageBox.Show("Талаларды киргизгиле!!!");
            }
        }

        private void BedCountForm_Load(object sender, EventArgs e)
        {
            
        }

    }
}